**************************************************************************************************
*** This do file creates the replication results for 
*** Thomas Pluemper, Eric Neumayer, Katharina Pfaff.
*** The Strategy of Protest Against Covid-19 Containment Policies in Germany 
*** Social Science Quarterly. First published: 09 September 2021. https://doi.org/10.1111/ssqu.13066
							
**************************************************************************************************
**************************************************************************************************
/* Note: You have to change "local DIR" to the directory you copy the original stata files contained 	*/
/* in the zip file and then run the do file. 
/* You must have Stata version 13 or higher installed													*/
**************************************************************************************************
*/

drop _all
clear matrix
clear mata


capture net install outreg2, from(http://fmwww.bc.edu/RePEc/bocode/o) /* checks whether outreg2 is installed 		*/



***********************************************************************************
local DIR = "d:\Research\Health for all database\Germany\"  /*change relative path to the directory where the files are located */
cd "`DIR'"
***********************************************************************************


use "Article for SSQ (Covid-19 Germany).dta", clear

* Table 1: Baseline model
nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using table1.xls, excel replace 


* Table 2: Robustness test: different stringency measures
* Oxford measure
nbreg  monthly_count_C19_events  stringencyindex infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using table2.xls, excel replace 

* ECDC measure
nbreg  monthly_count_C19_events  ecdc_agg_sum1_both infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using table2.xls, excel append 

corr infas_measures_dist_agg stringencyindex ecdc_agg_sum1_both if e(sample)

* Table 3: Robustness test: LDV & separate periods 
tsset
nbreg  monthly_count_C19_events  l.monthly_count_C19_events infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using table3.xls, excel replace 

nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc if month<6, cluster(mcode)
outreg2 using table3.xls, excel append 

nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc if month>=6 & month<=9, cluster(mcode)
outreg2 using table3.xls, excel append 

nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc if month>9, cluster(mcode)
outreg2 using table3.xls, excel append 

* Table 4: Robustness test: regional heterogeneity
nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc i.bundesland_id, cluster(mcode)
outreg2 using table4.xls, excel replace 

nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc  if east_germany_dum==0 , cluster(mcode)
outreg2 using table4.xls, excel append 

nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc  if east_germany_dum==1 , cluster(mcode)
outreg2 using table4.xls, excel append

* Table 5: Robustness test: hurdle model and outlier analysis
logit  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using table5.xls, excel replace 

ztp  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc if monthly_count_C19_events>0, cluster(mcode)
outreg2 using table5.xls, excel append 

* Appendix 2

use "Article for SSQ (Covid-19 Germany).dta", clear

* Baseline model
quietly nbreg  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
sum  monthly_count_C19_events  infas_measures_dist_agg infas_mortality_rate mainstream_vote_share ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc if e(sample)

 
*** Non-reported robustness tests Online appendix

* Exclude all events mentioning organizing groups other than Querdenken
use "Article for SSQ (Covid-19 Germany).dta", clear

nbreg  protest_ac mainstream_vote_share infas_measures_dist_agg infas_mortality_rate  ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using tableA1.xls, excel replace 


* FDP not part of mainstream party definition
use "Article for SSQ (Covid-19 Germany).dta", clear

nbreg  monthly_count_C19_events mainstream_nofdp_vote_share infas_measures_dist_agg infas_mortality_rate  ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using tableA2.xls, excel replace 

* Most recent state elections instead of last federal election
use "Article for SSQ (Covid-19 Germany).dta", clear

nbreg  monthly_count_C19_events mainstream_vote_share_infas_lw infas_measures_dist_agg infas_mortality_rate  ln_pop  centrality_4_highest pop_density anteil_beschaftigte_mit_akademis  GDP_pc , cluster(mcode)
outreg2 using tableA3.xls, excel replace 
